package cn.ynrcb.personnelfile.admin.service.impl;

import cn.hutool.core.convert.Convert;
import cn.ynrcb.personnelfile.admin.param.DemandInfoListParam;
import cn.ynrcb.personnelfile.common.utils.PageUtils;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.stereotype.Service;

import java.util.List;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import cn.ynrcb.personnelfile.admin.dao.DemandInfoDao;
import cn.ynrcb.personnelfile.admin.entity.DemandInfoEntity;
import cn.ynrcb.personnelfile.admin.service.DemandInfoService;


@Service("demandInfoService")
public class DemandInfoServiceImpl extends ServiceImpl<DemandInfoDao, DemandInfoEntity> implements DemandInfoService {

    @Override
    public PageUtils queryPage(DemandInfoListParam params) {
        Page<DemandInfoEntity> page = new Page<DemandInfoEntity>(Convert.toLong(params.getPage(),1L), Convert.toLong(params.getLimit(),15L));
        List<DemandInfoEntity> list = baseMapper.queryPage(page, params);
        page.setRecords(list);
        return new PageUtils((IPage<?>) page);
    }

}